import React, { Component } from 'react';
import './App.css';
import NavigationBar from "./components/NavigationBar";
import Borard from  "./components/Borard";
import InputBox from './components/InputBox';

class App extends Component {
  constructor(props){
    super(props);

    this.state = {
      title:"我是向子组件传递的默认标题"
    }
  }
  receiveChildComponetsMessage=(message)=>{
    console.log(message);
    console.log(this)
  }

  render() {
    return (
      <div className="App">
       <button onClick={()=>{
         this.setState({
           title:"我是向子组件传递的新的标题"
         })
       }}>点击改变向NavigationBar组件传递的数据</button>
       <NavigationBar title={this.state.title}
       sendMessage={this.receiveChildComponetsMessage}/>
       <Borard/>
       <InputBox/>
      </div>
    );
  }
}

export default App;
